<?php

class cidian {
	var $q;
	function __construct($content) {

		$this->q=substr($content, 2);
		//$res=$this->cd();
	}

	function cd() {
		$url='http://apistore.baidu.com/microservice/dictionary?query='.$this->q.'&from=en&to=zh';
		$res=file_get_contents($url);
		$res=json_decode($res,true);
		$parts=$res['retData']['dict_result']['symbols'][0]['parts'];
		$c=count($parts);
		$result='';
		for($i=0;$i<$c;$i++){
			$result.= $parts[$i]['part'];
			$count=count($parts[$i]['means']);
			for($j=0;$j<$count;$j++) {
				$result.= ($j+1).'、'.$parts[$i]['means'][$j];
			}
			$result.= '/:<W>';
		}
		return $result;
	}
}